how to convert list to array in java